<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
  <meta http-equiv=content-type
        content="text/html; charset=UTF-8"/>
  <title>用户列表</title>
  <link rel="stylesheet" href="../css/index.css" type="text/css" media="screen" charset="utf-8"/>
  <link rel="stylesheet" href="../css/jquery-ui-1.8.14.custom.css" type="text/css" media="screen" charset="utf-8"/>
  <script type="text/javascript" src="../js/jquery-1.6.js"></script>
  <script type="text/javascript" src="../js/jquery-ui-1.8.14.custom.min.js"></script>
  <script type="text/javascript" src="../js/common.js"></script>
  <script type="text/javascript" src="../js/list_user.js"></script>
</head>
<body class="newbie">
<div id="pagemasker"></div>
<div id="dialog"></div>
<div id="doc">
  <jsp:include page="../common/adminHeader.jsp"/>

  <div id="bdw" class="bdw">
    <div id="bd" class="cf">
      <div id="coupons">
        <div class="dashboard" id="dashboard">
          <ul>
            <li class="current">
              <a href="/admin/listUser.action">用户列表</a><span></span>
            </li>
            <li>
              <a href="/admin/listAdmin.action">管理员列表</a><span></span>
            </li>
          </ul>
        </div>

<div id="content" class="coupons-box clear mainwide">
  <div class="box clear">
    <div class="box-top"></div>
    <div class="box-content">
      <div class="head">
        <h2>用户列表</h2>
      </div>
      <div class="sect">
        <table id="user_table" cellspacing="0" cellpadding="0"
               border="0" class="coupons-table">
          <tr>
            <th width="30" align="center">ID</th>
            <th width="170">Email</th>
            <th width="70" nowrap>用户名</th>
            <th width="50">城市</th>
            <th width="140">注册时间</th>
            <th width="120">联系电话</th>
            <th width="80">权限</th>
            <th width="40">操作</th>
          </tr>
          <s:iterator id="user" value="users">
            <tr class="alt" id="team-list-id-3">
              <td align="center">${user.id}</td>
              <td>
                <a title="发送邮件" href="#"
                   onclick="return sendMail('${user.email}');"><img
                    src="../image/common/email.png"
                    style="vertical-align: middle;"/>&nbsp;${user.email}</a>
              </td>
              <td>${user.username}</td>
              <td>${user.city.chnName}</td>
              <td>${user.formatRegTime}</td>
              <td>
                <a title="发送短信" href="#" onclick="return sendSMS('${user.mobile}');">
                  <img
                      src="../image/common/phone.png"
                      style="vertical-align: middle;" alt=""/>&nbsp;${user.mobile}</a>
              </td>
              <td>
                <c:choose>
                  <c:when test="${user.accountType == 1}">
                    <a href="/admin/listAdmin.action">
                      <img src="../image/common/user-admin.png"
                           style="vertical-align: middle;" alt=""/>管理员
                    </a>
                  </c:when>
                  <c:when test="${user.accountType == 0}">
                    <img src="../image/common/user-star.png"
                         style="vertical-align: middle;" alt=""/>普通用户
                  </c:when>
                  <c:otherwise>
                    <img src="../image/common/user_green.png"
                         style="vertical-align: middle;" alt=""/><font
                      color="red">未验证</font>
                  </c:otherwise>
                </c:choose>
              </td>
              <td class="op">
                <a href="/admin/editUser.action?id=${user.id}"><img
                    src="../image/common/edit.png" alt="编辑" title="编辑"/></a>
                <a onclick="confirmDelete('确认删除用户${user.username}?<br><br>此操作无法恢复!',
                  '/admin/deleteUser.action?id=${user.id}')" href="#"><img
                    src="../image/common/cross.png" alt="删除" title="删除"/></a>
              </td>
            </tr>
          </s:iterator>
          <tr>
            <jsp:include page="../common/pager.jsp"/>
          </tr>
        </table>
      </div>
    </div>
    <div class="box-bottom"></div>
  </div>
</div>

      </div>
    </div>
    <!-- bd end -->
  </div>
  <jsp:include page="../common/footer.jsp"/>
</div>
</body>
</html>

<jsp:include page="../common/dialog/send_mail_dialog.jsp"/>
<jsp:include page="../common/dialog/send_sms_dialog.jsp"/>